package Servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import modelo.Comentario;
import service.MantenimientoService;

 
@WebServlet("/RegistrarComentario")
public class RegistrarComentario extends HttpServlet {
	private static final long serialVersionUID = 1L;
	MantenimientoService servicio = new MantenimientoService();
    
    public RegistrarComentario() {
        super();
         
    }

	 
	 
 
	protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		Comentario objCom = new Comentario(
				req.getParameter("nombre"),
				req.getParameter("comentario"));

			servicio.registrarcomentario(objCom);
			 
			req.getRequestDispatcher("/comentarOferta.jsp").forward(req, res);
		
		
		
				
		
		
		
	}

}
